package com.xuanxing123.dao.hibernate;

import com.xuanxing123.dao.ProductTypeDao;
import com.xuanxing123.model.ProductType;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository("productTypeDao")
public class ProductTypeDaoHibernate extends GenericDaoHibernate<ProductType, Long> implements ProductTypeDao {

    public ProductTypeDaoHibernate() {
        super(ProductType.class);
    }

    /**
     * {@inheritDoc}
    */
    @SuppressWarnings("unchecked")
    public List<ProductType> getAll() {
        return getHibernateTemplate().find("from ProductType order by position");
    }
}
